﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Archive.aspx.cs" Inherits="TaskWebApplicationUI.Archive"
         ValidateRequest="false" MasterPageFile="WebTasksMaster.Master" Theme="TaskTheme" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MasterPagePlaceHolder" runat="server">
    <p style="text-align: center;"> 
        <asp:Label ID="Department" runat="server" Text="Отдел" Font-Bold="False" SkinID="Department"></asp:Label></p>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:CheckBox ID="ShowSearchPanelCB" runat="server" AutoPostBack="True" OnCheckedChanged="EnableSearchCB_CheckedChanged"
                          Text="Показать форму поиска" CssClass="bodytr" />
            <asp:Panel ID="SearchPanel" runat="server" Visible="False">
                <table class="spisok" style="width: 50%; border: none;">
                    <tr>
                        <td>
                            <asp:Label ID="Label7" runat="server" Text="По дате создания:" SkinID="Details"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="DateCreateFromTB" onclick="scwShow(this,event);" runat="server"
                                         CssClass="bodyt"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="DateCreateToTB" onclick="scwShow(this,event);" runat="server" CssClass="bodyt"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label8" runat="server" Text="По дате закрытия:" SkinID="Details"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="DateCloseFromTB" onclick="scwShow(this,event);" runat="server" CssClass="bodyt"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="DateCloseToTB" onclick="scwShow(this,event);" runat="server" CssClass="bodyt"></asp:TextBox>
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label15" runat="server" SkinID="Details" Text="По номеру задачи:"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="tbTaskIntCode" runat="server" CssClass="bodyt"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label6" runat="server" SkinID="Details" Text="По ID задачи:"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="tbTaskGuid" runat="server" CssClass="bodyt"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label9" runat="server" Text="По названию задачи:" 
                                       SkinID="Details"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="SubjectTB" runat="server" CssClass="bodyt"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label10" runat="server" Text="По комментарию:" SkinID="Details"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="CommentTB" runat="server" CssClass="bodyt"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label11" runat="server" Text="По владельцу:" SkinID="Details"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="OwnerDDL" runat="server" AppendDataBoundItems="True" CssClass="bodyt"
                                              DataTextField="Name" DataValueField="ID">
                                <asp:ListItem Value="00000000-0000-0000-0000-000000000000">Любой</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label12" runat="server" Text="По исполнителю:" SkinID="Details"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="ExecutorDDL" runat="server" AppendDataBoundItems="True" CssClass="bodyt"
                                              DataTextField="Name" DataValueField="ID">
                                <asp:ListItem Value="00000000-0000-0000-0000-000000000000">Любой</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label13" runat="server" Text="По участнику:" SkinID="Details"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="ParticipantDDL" runat="server" AppendDataBoundItems="True"
                                              CssClass="bodyt" DataTextField="Name" DataValueField="ID">
                                <asp:ListItem Value="00000000-0000-0000-0000-000000000000">Любой</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <caption>
                        <br />
                    </caption>
                </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label14" runat="server" Text="По имени файла:" SkinID="Details"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="FileNameTB" runat="server" CssClass="bodyt"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label3" runat="server" Text="По отделу:" SkinID="Details"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="DepartmentDDL" runat="server" AppendDataBoundItems="True" CssClass="bodyt"
                                              DataTextField="Name" DataValueField="ID">
                                <asp:ListItem Selected="True" Value="00000000-0000-0000-0000-000000000000">В любом отделе</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label4" runat="server" Text="По тегу:" SkinID="Details"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="TagTB" runat="server" CssClass="bodyt"></asp:TextBox>
                        </td>
                    </tr>
                     <tr>
                        <td>
                            <asp:Label ID="Label5" runat="server" Text="Количество:" SkinID="Details"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="CountTask" runat="server" CssClass="bodyt">100</asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:CheckBox ID="WorkCB" runat="server" CssClass="bodyt" 
                                          Text="Не закрытые задачи" />
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                </table>
                <br />
                <asp:LinkButton ID="DoSearchLB" runat="server" OnClick="DoSearchLB_Click" CssClass="bodyt">Начать поиск</asp:LinkButton>
                <br />
            </asp:Panel>
            <asp:DataList ID="ExecutorsList" runat="server" OnItemDataBound="ExecutorsList_ItemDataBound"
                          Width="100%">
                <ItemTemplate>
                    <br />
                    <asp:Image ID="Image2" runat="server" ImageUrl='<%#"images/" + DataBinder.Eval(Container.DataItem,
                                                         "FullName")%>' />
                    &nbsp;<asp:Label ID="Label1" runat="server" Text="(всего:" SkinID="Executor"></asp:Label>
                    <asp:Label ID="TaskCountLabel" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "CountTask")%>'
                               SkinID="Executor"></asp:Label>
                    <asp:Label ID="Label2" runat="server" Text=")" SkinID="Executor"></asp:Label>
                    <br />
                    <asp:GridView ID="TasksListGridView" runat="server" AutoGenerateColumns="False" BorderWidth="1px"
                                  CssClass="grid-view" GridLines="None" CellPadding="4" BorderStyle="None" Width="100%"
                                  AllowSorting="True" OnSorting="TasksListGridView_Sorting">
                        <%--   <AlternatingRowStyle BackColor="White"></AlternatingRowStyle>--%>
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Image ID="Image1" runat="server" ImageUrl="images/dot.gif" Height="15" />
                                </ItemTemplate>
                                <HeaderStyle CssClass="bodyt" HorizontalAlign="Right" />
                                <ItemStyle CssClass="bodyt" Width="15" />
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="">
                                <HeaderStyle CssClass="bodyt" HorizontalAlign="Left" />
                                <ItemStyle CssClass="bodyt" Width="1%" Wrap="False" HorizontalAlign="Left" Font-Size="10pt" />
                            </asp:BoundField>
                            <asp:HyperLinkField HeaderText="" DataTextField="TaskName" DataNavigateUrlFields="HyperLink">
                                <HeaderStyle CssClass="bodyt" HorizontalAlign="Left" />
                                <ItemStyle CssClass="bodyt" Wrap="False" HorizontalAlign="Left" />
                            </asp:HyperLinkField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Image ID="Image1" runat="server" ImageUrl="images/exclamation.gif" Visible='<%#Eval("ImageLink.Exclamation")%>'
                                               Height="15" />
                                </ItemTemplate>
                                <HeaderStyle CssClass="bodyt" HorizontalAlign="Left" />
                                <ItemStyle CssClass="bodyt" Width="15" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Image ID="Image1" runat="server" ImageUrl="images/reminder.gif" Visible='<%#Eval("ImageLink.Reminder")%>'
                                               Height="15" />
                                </ItemTemplate>
                                <HeaderStyle CssClass="bodyt" HorizontalAlign="Left" />
                                <ItemStyle CssClass="bodyt" Width="15" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Image ID="Image1" runat="server" ImageUrl="images/participant.gif" Visible='<%#Eval("ImageLink.iamParticipant")%>'
                                               Height="15" />
                                </ItemTemplate>
                                <HeaderStyle CssClass="bodyt" HorizontalAlign="Left" />
                                <ItemStyle CssClass="bodyt" Width="15" />
                            </asp:TemplateField>
                            <asp:BoundField HtmlEncode="false" HeaderText="Отдел" DataField="Department" SortExpression="Department">
                                <HeaderStyle CssClass="bodyt" HorizontalAlign="Right" />
                                <ItemStyle CssClass="bodyt" Width="6%" Wrap="False" HorizontalAlign="Right" />
                            </asp:BoundField>
                         
                            <asp:BoundField HtmlEncode="false" HeaderText="Владелец" DataField="Owner" SortExpression="Owner">
                                <HeaderStyle CssClass="bodyt" HorizontalAlign="Right" />
                                <ItemStyle CssClass="bodyt" Width="6%" Wrap="False" HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField HtmlEncode="False" HeaderText="Исполнитель" DataField="Executor"
                                            SortExpression="Executor">
                                <HeaderStyle CssClass="bodyt" HorizontalAlign="Right" />
                                <ItemStyle CssClass="bodyt" Width="6%" Wrap="False" HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField HtmlEncode="false" HeaderStyle-CssClass="bodyt" HeaderText="Создана"
                                            DataFormatString="{0:d} {0:t}" DataField="DateCreate" SortExpression="DateCreate">
                                <HeaderStyle CssClass="bodyt" />
                                <ItemStyle CssClass="bodyt" Width="1%" Wrap="False" />
                            </asp:BoundField>
                            <asp:BoundField HtmlEncode="false" HeaderStyle-CssClass="bodyt" HeaderText="Закрыта"
                                            DataFormatString="{0:d} {0:t}" DataField="DateClose" SortExpression="DateClose">
                                <HeaderStyle CssClass="bodyt" />
                                <ItemStyle CssClass="bodyt" Width="1%" Wrap="False" />
                            </asp:BoundField>
                            <asp:BoundField HtmlEncode="false" HeaderText="Тег" DataField="Tag" SortExpression="Tag">
                                <HeaderStyle CssClass="bodyt" HorizontalAlign="Center" />
                                <ItemStyle CssClass="bodyt" Width="5%" Wrap="False" HorizontalAlign="Left" />
                            </asp:BoundField>
                        </Columns>
                        <%-- <RowStyle BackColor="#F7F7DE"></RowStyle>--%>
                    </asp:GridView>
                </ItemTemplate>
            </asp:DataList>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>